package com.ctgu.fastleader.controller;

import com.ctgu.fastleader.service.GoodsSeatService;
import com.ctgu.fastleader.service.ShelfService;
import com.ctgu.fastleader.service.WareHouseService;
import com.ctgu.fastleader.vo.GoodsSeat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/goodsSeat")
public class GoodsSeatController {
    @Resource
    GoodsSeatService goodsSeatService;

    @Resource
    WareHouseService wareHouseService;

    @ResponseBody
    @RequestMapping("/findAllGoodsByShelfIdAndHouseName")
    public List<GoodsSeat> findAllGoodsByShelfIdAndHouseName(String housename, String shelfid){
        Integer houseid = wareHouseService.selectHouseIdByHouseName(housename);
        return goodsSeatService.findAllRecordByShelfIdAndHouseId(shelfid,houseid);
    }
}
